package cn.fayang.ymcc.feing;

import cn.fayang.ymcc.domain.MessageStation;
import cn.fayang.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StationMessageFeignClientFallBackFactory implements FallbackFactory<StationMessageFeingCilent> {

    @Override
    public StationMessageFeingCilent create(Throwable throwable) {
        return new StationMessageFeingCilent() {
            @Override
            public JSONResult saveOrUpdate(MessageStation messageStation) {
                return JSONResult.error("站内信服务不可达");
            }
        };
    }
}
